Page({
    alert(){
        my.alert({
            title: '亲',
            content: '您本月的账单已出',
            buttonText: '我知道了',
            success: () => {
                my.alert({
                title: '用户点击了「我知道了」',
                });
            },
        });
    },
    confirm(){
        my.confirm({
            title: '温馨提示',
            content: '您是否想查询快递单号：1234567890',
            confirmButtonText: '马上查询',
            cancelButtonText: '暂不需要',
            success: (result) => {
                my.alert({
                title: `${result.confirm}`,
                });
            },
        });
    },
    showToast(){
        my.showToast({
            type: 'success',
            content: '操作成功',
            duration: 3000,
            success: () => {
                my.alert({
                title: 'toast 消失了',
                });
            },
        });
    },
    hideToast(){
        my.hideToast()
    },
    showLoading(){
        my.showLoading({
            content: '加载中...',
            delay: 1000,
        });
    },
    hideLoading(){
        my.hideLoading();
    },
    showActionSheet(){
        my.showActionSheet({
            title: '支付宝-ActionSheet',
            items: ['菜单一', '菜单二', '菜单三'],
            cancelButtonText: '取消好了',
            success: (res) => {
                const btn = res.index === -1 ? '取消' : '第' + res.index + '个';
                my.alert({
                title: `你点了${btn}按钮`
                });
            },
        });
    }
})